import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';
import { NativeProvider } from '../../providers/native/native';

/**
 * Generated class for the ShopdetailPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-shopdetail',
  templateUrl: 'shopdetail.html',
})
export class ShopdetailPage {
  shop:any;
  constructor(public navCtrl: NavController, public navParams: NavParams,private busi:BusiProvider,private nativ:NativeProvider) {
    this.shop = this.navParams.get("shop");
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ShopdetailPage');
  }

  shopSh(type){
    const para={
      shopId:this.shop.shop_id,
      type:type
    }
    this.busi.shopSh(para).subscribe(data=>{
      this.nativ.showToast("操作成功");
      this.navCtrl.pop();
    },error=>{

    })
  }

}
